<template>
    <view>
        <template v-for="(item, index) in AVEncVideoWidgetList">
            <j-cell-group :key="index" :title="'通道' + index">
                <j-cell-card title="基本信息" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <j-cell title="通道名称" :tips="item.ChannelTitle.Name" :more="false"></j-cell>
                    <j-cell title="通道编号" :tips="item.ChannelTitle.SerialNo" :more="false"></j-cell>
                </j-cell-card>
                <j-cell-card title="通道标题属性" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <j-cell title="背景色" :tips="item.ChannelTitleAttribute.BackColor" :more="false"></j-cell>
                    <j-cell title="前景色" :tips="item.ChannelTitleAttribute.FrontColor" :more="false"></j-cell>
                    <j-cell title="编码混合" :more="false">
                        <view slot="tips">
                            <switch :checked="item.ChannelTitleAttribute.EncodeBlend" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="预览混合" :more="false">
                        <view slot="tips">
                            <switch :checked="item.ChannelTitleAttribute.PreviewBlend" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="物体边距与整长的比例" :tips="item.ChannelTitleAttribute.RelativePos" :more="false"></j-cell>
                </j-cell-card>
                <j-cell-card title="区域覆盖" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <template v-for="(pro, index1) in item.Covers">
                        <j-cell-card :key="index1" :title="'属性' + index" :show="false" :is-touch="false" border style="background: #f5f7fb">
                            <j-cell title="背景色" :tips="pro.BackColor" :more="false"></j-cell>
                            <j-cell title="前景色" :tips="pro.FrontColor" :more="false"></j-cell>
                            <j-cell title="编码混合" :more="false">
                                <view slot="tips">
                                    <switch :checked="pro.EncodeBlend" disabled></switch>
                                </view>
                            </j-cell>
                            <j-cell title="预览混合" :more="false">
                                <view slot="tips">
                                    <switch :checked="pro.PreviewBlend" disabled></switch>
                                </view>
                            </j-cell>
                            <j-cell title="物体边距与整长的比例" :tips="pro.RelativePos" :more="false"></j-cell>
                        </j-cell-card>
                    </template>
                </j-cell-card>
                <j-cell title="遮挡数量" :tips="item.CoversNum" :more="false"></j-cell>
                <j-cell-card title="时间标题属性" :show="false" :is-touch="false" border style="background: #f5f7fb">
                    <j-cell title="背景色" :tips="item.TimeTitleAttribute.BackColor" :more="false"></j-cell>
                    <j-cell title="前景色" :tips="item.TimeTitleAttribute.FrontColor" :more="false"></j-cell>
                    <j-cell title="编码混合" :more="false">
                        <view slot="tips">
                            <switch :checked="item.TimeTitleAttribute.EncodeBlend" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="预览混合" :more="false">
                        <view slot="tips">
                            <switch :checked="item.TimeTitleAttribute.PreviewBlend" disabled></switch>
                        </view>
                    </j-cell>
                    <j-cell title="物体边距与整长的比例" :tips="item.TimeTitleAttribute.RelativePos" :more="false"></j-cell>
                </j-cell-card>
            </j-cell-group>
        </template>
    </view>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            AVEncVideoWidgetList: [],

            pro: {
                BackColor: '',
                FrontColor: '',
                EncodeBlend: '',
                PreviewBlend: '',
                RelativePos: ''
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        console.log(options);
		this.token = options.token
		this.getconfig();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getconfig() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'AVEnc.VideoWidget'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                uni.hideLoading({
                    success: (res) => {
                        console.log(result);
                        this.AVEncVideoWidgetList = result['AVEnc.VideoWidget']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
